package com.neonbacon.snake;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.Log;
import android.view.MotionEvent;


public class TouchPad{
Bitmap up;
Bitmap down;
Bitmap left; 
Bitmap right;
Bitmap middle;
Rect rightrect = null;
public TouchPad(Context c){
	up = BitmapFactory.decodeResource(c.getResources(), R.drawable.up);
	down = BitmapFactory.decodeResource(c.getResources(), R.drawable.down);
	left = BitmapFactory.decodeResource(c.getResources(), R.drawable.left);
	right = BitmapFactory.decodeResource(c.getResources(), R.drawable.right);
	middle = BitmapFactory.decodeResource(c.getResources(), R.drawable.middle);
	
}
public void draw(Canvas c,int width,int height){
	if(rightrect == null)
		rightrect =  new Rect(width - (width/5),0,width / 4,height / 2);
	
Paint p = new Paint();
p.setColor(Color.RED);
Rect leftrect = new Rect(0,0,(width / 4),height);

c.drawRect(leftrect, p);
p.setColor(Color.WHITE);
c.drawRect(rightrect, p);
}

public void onTouchEvent(MotionEvent e,EntitySnake s,int width,int height){
	Rect touch =  new Rect((int)e.getX(),(int)e.getY(),32,32);
	rightrect.left++;
	rightrect.bottom++;
	rightrect.right++;
    Log.d("JACK", "LEFT = " + rightrect.left);
    Log.d("JACK","BOTTOM = " + rightrect.bottom);
    Log.d("JACK","RIGHT = " + rightrect.right);
    Log.d("JACK", "TOP = " + rightrect.top);
}
}
